#ifndef MCL_ARGS_H
// [internal use only] mcl_args___args: a structure to hold argument flags and
// attributes
typedef struct {
   int no;                 // number of argument after the flag (if zero, flag not set)
   int start;              // index of the first argument after the flag
   const char *lf;         // long flag
   const char *disc;       // discription
   char sf;                // short flag
} mcl_args___args;

// mcl_args_c: the args context structure
typedef struct {
   int count;              // number of regesterd flags
   int status;             // error indicator
   int before;               // the index of the last argement that isn't preceeded by a flag
   int openflag;        // the current flag mcl_args is working with (internal)
   mcl_args___args *list;  // list of all regestered flags and their attributes
   const char *name;             // name of program
   const char *version;          // version
   const char *summary;          // summary of what the program does
   const char *details;          // optional: extra information which may be examples, warnings and so on.
} mcl_args_c;



mcl_args_c* mcl_args_init( const char *name, 
                           const char *version, 
                           const char *summary, 
                           const char *details);
/*returns an initialized library context. you should always check the status TODO
to make sure the context was initialized properly. */

int mcl_args_add( mcl_args_c *context, 
                  const char *longname, 
                  char shortname, 
                  const char *discription);
/*
adds a flag to the flags that should be parsed. 
The following flags are reserved:
short flags: h, v
long flags: help, version
*/

int mcl_args_parse(  mcl_args_c *c, 
                     int argc, 
                     char **argv);
/*check the return status for errors*/

int mcl_args_get_count(mcl_args_c *c, const char *longflag);
int mcl_args_get_start(mcl_args_c *c, const char *longflag);
int mcl_args_get_before(mcl_args_c *c);
/* These return indexes */

mcl_args_c* mcl_args_fin(mcl_args_c *context);
/*
frees the memory used for 'context'
*/

#define MCL_ARGS_H
#endif
